<?php
//我的提案

function xinjian_default(){
    xinjian_page();
}
function xinjian_page(){
    _output_template(0,'xinjian');
}


function _zhengxie_outputXinjian(){

    $count = getProposalCount();
    $str ="<div style='padding-top: 25px; padding-bottom: 25px;;padding-left:30px;border-radius: 10px;height: 90%;background-color: white; -webkit-box-shadow: #e2f0fe 0px 0px 10px;-moz-box-shadow: #e2f0fe 0px 0px 10px;box-shadow: #e2f0fe 0px 0px 10px;'>
                <div class='solide_box' style='height: 100%;width: 100%;padding-right: 30px;overflow-y: auto'>
                <div  style='height: 12%;width: 100%;'>
                    <div style='width: 400px;height: 100%;position: relative;top: 50%;transform: translateY(-50%);margin: 0px auto'>
                        <div style='font-size: 26px;color: #333333;'>政协西安市碑林区第十四届委员会</div>
                        <div style='width: 180px;font-size: 26px;color: #333333;margin: 0px auto'>提案第".($count['num']+1)."号</div>
                    </div>
                </div>
                
                <div style='height: 10%;width: 100%'>
                    <div style='background-image: url(/images/xinjian/xingxing.png);background-repeat: no-repeat;background-position: 10px 38px;font-size: 20px;text-align: center;display: inline-block;min-width: 99px;width: 150px;height:100%;float: left;line-height: 4.5'>
                        案&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;由:
                    </div>
                    <div style='padding-left: 150px;height: 100%;'>
                        <input class='anyou' type='text' placeholder='内容不少于15字' style='background-color: #f9f9f9;border: 1px solid #ececec;color: #333;font-size: 20px;width: 100%;position: relative;top: 50%;transform: translateY(-50%);height: 58px'>
                    </div>
                </div>
                
                <div style='height: 10%;width: 48%;float: left'>
                    <div style='background-image: url(/images/xinjian/xingxing.png);background-repeat: no-repeat;background-position: 10px 38px;font-size: 20px;text-align: center;display: inline-block;min-width: 99px;width: 150px;height:100%;float: left;line-height: 4.5'>
                        提案类型:
                    </div>
                    <div style='padding-left: 150px;height: 100%;'>
                        <div class='select_1' style='text-align: center;background-color: #f9f9f9;line-height: 58px;border: 1px solid #ececec;color: #333;font-size: 20px;width: 100%;position: relative;top: 50%;transform: translateY(-50%);height: 58px'></div>
                        <ul class='sub_1' style='float: left'>
                            <li>经济类</li>
                            <li>文教体卫</li>
                            <li>政法统战政协</li>
                        </ul>
                        <style>
                            .sub_1{list-style-type:none;}
                            .select_1:hover{cursor:pointer;}
                            .sub_1{z-index: 9999;font-size: 16px;position: relative;top:16px;color:#e5e5e5;width:100%;background:#fff;border:1px solid #e5e5e5;display: none;}
                            .sub_1 li{color: #666666;height:40px;text-align: center;line-height:40px;cursor:pointer;border-bottom:1px solid #e5e5e5;}
                            .sub_1 li.hover{background:#8b8b8b;}
                        </style>
                        <script type='text/javascript'>
                            $('.select_1').click(function(event) {
                                $('.sub_1').css('display') == 'none' ? $('.sub_1').css('display','block') : $('.sub_1').css('display','none');
                            });
                            
                            $('.sub_1 li').each(function() {
                                
                                $(this).mouseover(function() {
                                    $(this).css('background-color','#429de3');
                                });
                                
                                $(this).mouseout(function() {
                                    $(this).css('background-color','#fff');
                                });
                                
                                $(this).click(function() {
                                  var text = $(this).text();
                                  $('.select_1').html(text);
                                  $('.sub_1').css('display','none');
                                });
                            });
                        </script>
                    </div>
                </div>
                
                <div style='height: 10%;width: 48%;margin-left: 4%;display: inline-block;'>
                    <div style='background-image: url(/images/xinjian/xingxing.png);background-repeat: no-repeat;background-position: 10px 38px;font-size: 20px;text-align: center;display: inline-block;min-width: 99px;width: 150px;height:100%;float: left;line-height: 4.5'>
                        届&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;次:
                    </div>
                    <div style='padding-left: 150px;height: 100%;'>
                        <div class='select_2' style='text-align: center;background-color: #f9f9f9;line-height: 58px;border: 1px solid #ececec;color: #333;font-size: 20px;width: 100%;position: relative;top: 50%;transform: translateY(-50%);height: 58px'></div>
                        <ul class='sub_2' style='float: right'>
                            <li>12</li>
                            <li>13</li>
                            <li>14</li>
                            <li>15</li>
                            <li>16</li>
                            <li>17</li>
                            <li>18</li>
                            <li>19</li>
                            <li>20</li>
                        </ul>
                        <style>
                            .sub_2{list-style-type:none;}
                            .select_2:hover{cursor:pointer;}
                            .sub_2{z-index: 9999;font-size: 16px;position: relative;top:16px;left:2px;color:#e5e5e5;width:100%;background:#fff;border:1px solid #e5e5e5;display: none;}
                            .sub_2 li{color: #666666;height:40px;text-align: center;line-height:40px;cursor:pointer;border-bottom:1px solid #e5e5e5;}
                            .sub_2 li.hover{background:#8b8b8b;}
                        </style>
                        <script type='text/javascript'>
                            $('.select_2').click(function(event) {
                                $('.sub_2').css('display') == 'none' ? $('.sub_2').css('display','block') : $('.sub_2').css('display','none');
                            });
                            
                            $('.sub_2 li').each(function() {
                                $(this).mouseover(function() {
                                    $(this).css('background-color','#429de3');
                                });
                                
                                $(this).mouseout(function() {
                                    $(this).css('background-color','#fff');
                                });
                                
                                $(this).click(function() {
                                  var text = $(this).text();
                                  $('.select_2').html(text);
                                  $('.sub_2').css('display','none');
                                });
                            });
                            
                        </script>
                    </div>
                </div>";

    $str .= "   <div style='height: 10%;width: 48%;float: left'>
                    <div class='userid_flag' id='".$GLOBALS['USERINFO']['id']."' style='background-image: url(/images/xinjian/xingxing.png);background-repeat: no-repeat;background-position: 10px 38px;font-size: 20px;text-align: center;display: inline-block;min-width: 99px;width: 150px;height:100%;float: left;line-height: 4.5'>
                        提&nbsp;&nbsp;案&nbsp;&nbsp;人:
                    </div>
                    <div  style='padding-left: 150px;height: 100%;'>
                        <input class='tianren' type='text' value='".$GLOBALS['USERINFO']['realname']."' style='text-align: center;background-color: #f9f9f9;line-height: 58px;border: 1px solid #ececec;color: #333;font-size: 20px;width: 100%;position: relative;top: 50%;transform: translateY(-50%);height: 58px'>
                    </div>
                </div>";

                
    $str .= "   <div style='height: 10%;width: 48%;margin-left: 4%;display: inline-block;'>
                    <div style='font-size: 20px;text-align: center;display: inline-block;min-width: 99px;width: 150px;height:100%;float: left;line-height: 4.5'>
                        附&nbsp;&nbsp;议&nbsp;&nbsp;人:
                    </div>
                    <div style='padding-left: 150px;height: 100%;'>
                        <input class='fuyiren' type='text' style='text-align: center;background-color: #f9f9f9;line-height: 58px;border: 1px solid #ececec;color: #333;font-size: 20px;width: 100%;position: relative;top: 50%;transform: translateY(-50%);height: 58px'>
                    </div>
                </div>
                
                <div style='width: 100%'>
                    <div style='background-image: url(/images/xinjian/xingxing.png);background-repeat: no-repeat;background-position: 10px 28px;font-size: 20px;text-align: center;display: inline-block;min-width: 99px;width: 150px;height:100%;float: left;line-height: 3.5'>
                        提案内容:
                    </div>
                    <div style='padding-left: 150px;height: 100%;'>
                        <textarea class='tianneirong' id='tiancontent' type='text' style='overflow: auto;resize: none;background-color: #f9f9f9;border: 1px solid #ececec;color: #333;font-size: 20px;width: 100%;position: relative;top: 50%;transform: translateY(-50%);'></textarea>
                    </div>
                </div>
                
                <div style='min-height: 16%;width: 100%'>
                    <div style='background-image: url(/images/xinjian/xingxing.png);background-repeat: no-repeat;background-position: 10px 28px;font-size: 20px;text-align: center;display: inline-block;min-width: 99px;width: 150px;height:100%;float: left;line-height: 3.5'>
                        提案建议:
                    </div>
                    <div style='padding-left: 150px;height: 100%;'>
                        <textarea class='tianjianyi' id='tianadvice' type='text' style='overflow: auto;resize: none;background-color: #f9f9f9;border: 1px solid #ececec;color: #333;font-size: 20px;width: 100%;position: relative;top: 50%;transform: translateY(-50%);height: 120px'></textarea>
                    </div>
                </div>
                
                <div style='height: 16%;width: 100%;'>
                    <div style='font-size: 20px;text-align: center;display: inline-block;min-width: 99px;width: 150px;height:100%;float: left;line-height: 7.5'>
                        添加附件:
                    </div>
                    <div style='padding-left: 150px;height: 100%;'>
                        <div type='text' style='color: #c9c9c9;font-size: 20px;width: 100%;position: relative;top: 50%;transform: translateY(-50%);height: 90px'>
                            <div class='photo-list' style='width: 91%'>
                                <div class='photo-grid'>
                                    <span>+</span>
                                    <input class='mobileupload' type='file' multiple>
                                </div>
                                <div style='clear:both'></div>
                            </div>
                        </div>
                    </div>
                    <style>
                        .photo-grid{
                            height: 90px;
                            width: 90px;
                            color: #f2f2f2;
                            float: left;
                            margin-left: 1px;
                            margin-top: 1px;
                            margin-bottom: 1px;
                            background-color: #ffcf80;
                            font-size: 30px;
                            line-height: 90px;
                            text-align: center;
                            cursor: pointer;
                            border: 1px solid #f2f2f2
                        }
                        
                        .mobileupload{
                            position: relative;
                            top:-90px;
                            cursor: pointer;
                            opacity: 0;
                            height: 90px;
                            width: 90px;
                        }
                        .redactor-editor{
                            padding: 10px;
                            min-height: 100px;
                        }
                        
                        #redactor-toolbar-0{
                            display: none;
                        }
                        #redactor-toolbar-1{
                            display: none;
                        }
                    </style>
                </div>
                
                <div style='height: 10%;width: 100%'>
                    <div class='xinjian_error_dialog' style='visibility: hidden;padding-left: 10px;padding-right: 10px;color: #f43f21;width: 250px;position: relative;left: 50%;top: -100px;transform: translateX(-50%);height: 50px;background-color: #3333;border-radius: 2px;line-height: 50px;text-align: center'>
                            
                    </div>
                    <button onclick='createProposal();' style='position: relative;left: 50%;top: -40px;transform: translateX(-50%);width: 260px;height: 68px;background-color: #4e99ff;border-radius: 4px;color: white;font-size: 20px'>提交</button>
                </div>
          </div>
          </div>";
    //$str.=redactor('tiancontent');
    return $str;
}


function _output_dialog(){
    $str = "    <div style='position: absolute;top: 25%;margin-left: 210px;left: 45%;transform: translateX(-50%); width: 686px;height: 460px;'>
                    <script>
                        function dissmissXinjianDialog() {
                            window.location.href = '?action=xinjian';
                        }
                    </script>
                    <div style='background-color: #429de3;background-image: url(/images/login/reset.png);background-size: 100% 100%;border-top-left-radius: 8px;border-top-right-radius: 8px;height: 194px;width: 100%'>
                        
                    </div>
                    <div style='background-color: white;height: 264px;width: 100%;border-bottom-left-radius: 8px;border-bottom-right-radius: 8px;'>
                        <div style='width: 390px;height: 190px;margin: 0px auto;'>
                            <div  style='color: #87ba4d;font-size: 26px;text-align: center;position: relative;top: 30%;transform: translateY(-30%);'>提交成功!</div>
                            <div class='successMessage' style='color: #87ba4d;font-size: 14px;text-align: center;position: relative;top: 50%;transform: translateY(-50%);'></div>
                        </div>
                        <div  style='background-color: white;height: 74px;width: 100%;border-bottom-left-radius: 8px;border-bottom-right-radius: 8px;'>
                            <div style='border-bottom-left-radius: 8px;border-bottom-right-radius: 8px;font-size: 18px;color: #469ee3;height: 74px;width: 100%;line-height: 74px;text-align: center;border-top: 1px solid #d2ebff'>
                                <button onclick='dissmissXinjianDialog()' style='background-color: #3e8ffe;width: 210px;height: 48px;border-radius: 10px;color: white;position: relative;font-size: 16px;margin: 0 auto;position: relative;top: 50%;transform: translateY(-50%);'>返回</button>
                            </div>
                        </div>
                    </div>
                </div>";
    return $str;
}